
# for j in range(1,4):
#     user_name = input("请输入用户名：")
#     user_pwd = input("请输入密码：")
#     i=0
#     key=False
#     with open("file/passworld.txt") as file_object:
#         # lines = file_object.readlines()
#         for line in file_object:
#             i+=1
#             if i%2!=0:
#                 user1 = line[10:-1]
#                 # print(user1)
#             else:
#                 user2 = line[9:-1]
#                 # print(user2)
#             if i%2==0 and user1==user_name and user2 == user_pwd:
#                 print("恭喜登录成功！")
#                 key=True
#                 break
#     if key==False:
#         print("剩余"+str(3-j)+"次机会")


flag=False
j=2
while flag==False:
    user_name = input("请输入用户名：")
    user_pwd = input("请输入密码：")
    with open("file/passworld.txt") as file_object:
        # lines = file_object.readlines()
        for line in file_object:
            i=0
            i+=1
            if i%2!=0:
                user1 = line[10:-1]
                # print(user1)
            else:
                user2 = line[9:-1]
                # print(user2)
            if i%2==0 and user1==user_name and user2 == user_pwd:
                print("恭喜登录成功！")
                flag=True
                # break
    if flag==False:
        print("剩余"+str(j)+"次机会")
        j=j-1
        if j==-1:
            key=True

